Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 1 | // -*- C++ -*- |
2 | //===-------------------------- cerrno ------------------------------------===// | ||||
3 | // | ||||
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 | [diff] [blame] | 4 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 5 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
7 | // Source Licenses. See LICENSE.TXT for details. | ||||
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 8 | // |
9 | //===----------------------------------------------------------------------===// | ||||
10 | |||||
11 | #ifndef _LIBCPP_CERRNO | ||||
12 | #define _LIBCPP_CERRNO | ||||
13 | |||||
14 | /* | ||||
15 | cerrno synopsis | ||||
16 | |||||
17 | Macros: | ||||
18 | |||||
19 | EDOM | ||||
20 | EILSEQ // C99 | ||||
21 | ERANGE | ||||
22 | errno | ||||
23 | |||||
24 | */ | ||||
25 | |||||
26 | #include <__config> | ||||
27 | #include <errno.h> | ||||
28 | |||||
29 | #pragma GCC system_header | ||||
30 | |||||
31 | #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) | ||||
32 | |||||
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 33 | #ifdef ELAST |
34 | |||||
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 35 | const int __elast1 = ELAST+1; |
36 | const int __elast2 = ELAST+2; | ||||
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 37 | |
38 | #else | ||||
39 | |||||
40 | const int __elast1 = 104; | ||||
41 | const int __elast2 = 105; | ||||
42 | |||||
43 | #endif | ||||
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 44 | |
45 | #ifdef ENOTRECOVERABLE | ||||
46 | |||||
47 | #define EOWNERDEAD __elast1 | ||||
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 48 | |
49 | #ifdef ELAST | ||||
50 | #undef ELAST | ||||
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 51 | #define ELAST EOWNERDEAD |
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 52 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 53 | |
54 | #elif defined(EOWNERDEAD) | ||||
55 | |||||
56 | #define ENOTRECOVERABLE __elast1 | ||||
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 57 | #ifdef ELAST |
58 | #undef ELAST | ||||
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 59 | #define ELAST ENOTRECOVERABLE |
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 60 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 61 | |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 | [diff] [blame] | 62 | #else // defined(EOWNERDEAD) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 63 | |
64 | #define EOWNERDEAD __elast1 | ||||
65 | #define ENOTRECOVERABLE __elast2 | ||||
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 66 | #ifdef ELAST |
67 | #undef ELAST | ||||
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 68 | #define ELAST ENOTRECOVERABLE |
Howard Hinnant | 8c1aa2c | 2011-04-10 19:46:55 | [diff] [blame] | 69 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 70 | |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 | [diff] [blame] | 71 | #endif // defined(EOWNERDEAD) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 72 | |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 | [diff] [blame] | 73 | #endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 | [diff] [blame] | 74 | |
75 | #endif // _LIBCPP_CERRNO |